import sys
sys.path.append('..\\..')
from Djoser import *


root = Tk()
f1 = Frame(root)
f1.pack()

lbl = DjLabel(f1, text='hello')
lbl.pack()


def test(n):
	#test properties
	if n==0:
		lbl.text = 's&omething'
		assert lbl.text == 's&omething'
	if n==1: 
		lbl.bgcolor=(200,255,255)
		lbl.color = (255,0,0)
		print lbl.bgcolor, lbl.color
	elif n==2:
		lbl.borderstyle='raised'
		assert str(lbl.borderstyle)=='raised'
	elif n==3:
		lbl.borderwidth=4
		assert str(lbl.borderwidth)=='4'
	elif n==4:
		lbl.enabled = not lbl.enabled
	elif n==5:
		lbl.font = ('Times New Roman', 12, 'normal')
		print lbl.font
	elif n==6:
		lbl.height = 5
		lbl.width = 10
		assert lbl.height == 5 and lbl.width == 10
	elif n==7:
		lbl.anchor = 'e'
		assert str(lbl.anchor)=='e'
	elif n==8:
		lbl.text = 'a lot of long text that will have to wrap'
		lbl.wrapwidth=40
	elif n==9:
		lbl.text = 'a lot of long text that will have to wrap'
		lbl.wrapwidth=40
		lbl.alignment='right'
	elif n==10:
		import time
		lbl.text = '3'
		time.sleep(0.5)
		lbl.text = '2'
		time.sleep(0.5)
		lbl.text = '1'
		

f = Frame(root)
f.pack()
Button(f,text='text',command=lambda:test(0)).pack(side=LEFT)
Button(f,text='Colors',command=lambda:test(1)).pack(side=LEFT)
Button(f,text='BorderStyle',command=lambda:test(2)).pack(side=LEFT)
Button(f,text='BorderWidth',command=lambda:test(3)).pack(side=LEFT)
Button(f,text='disable',command=lambda:test(4)).pack(side=LEFT)
Button(f,text='font',command=lambda:test(5)).pack(side=LEFT)
	
Button(f,text='width/height',command=lambda:test(6)).pack(side=LEFT)
Button(f,text='anchor',command=lambda:test(7)).pack(side=LEFT)
Button(f,text='wrap text',command=lambda:test(8)).pack(side=LEFT)
Button(f,text='alignment',command=lambda:test(9)).pack(side=LEFT)
Button(f,text='use as status',command=lambda:test(10)).pack(side=LEFT)

f.mainloop()
